Skip to content

Add the lack of proper gamut mapping in OKLch and Oklab. The browser support is thus only parial. #26841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pygy
Copy link

@pygy pygy commented May 19, 2025

Summary

The current browser implementation of gamut mapping is buggy and not spec compliant. This has accessibility ramifications (the spec ensures that color contrast is preserved, even if a color is beyond what a user can display, but browser don't respect that invariant in their implementation).

Test results and supporting details

Visit https://vasilis.nl/dingen/bugs/oklch.html

The squares should be white and black per spec, they aren't in any browser.

Related issues

This fixes #26838

@github-actions github-actions bot added data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS size:m [PR only] 25-100 LoC changed labels May 19, 2025
Copy link
Contributor

github-actions bot commented May 19, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS size:m [PR only] 25-100 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

css.types.color.oklab and css.types.color.oklab: Browsers are not spec compliant, support is only partial.
2 participants